/*******************************************************************************
 * (c) Copyright 2016 Hewlett-Packard Development Company, L.P.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Apache License v2.0 which accompany this distribution.
 *
 * The Apache License is available at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 *******************************************************************************/
package io.cloudslang.lang.runtime.bindings.strategies;

import io.cloudslang.lang.entities.bindings.Input;
import io.cloudslang.lang.entities.bindings.values.Value;
import io.cloudslang.lang.runtime.env.RunEnvironment;
import io.cloudslang.lang.runtime.events.LanguageEventData;
import io.cloudslang.score.lang.ExecutionRuntimeServices;
import io.cloudslang.score.lang.SystemContext;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;

public interface InputHandler {
    /**
     * @param newInputs   the list of inputs for
     * @param systemContext   the system context
     * @param runEnv          the run environment
     * @param runtimeServices the runtime services
     * @param stepType        the step type
     * @param stepName        the step name
     * @return boolean flag to indicate if engine can continue
     */
    boolean resolveInputs(List<Input> newInputs,
                          SystemContext systemContext,
                          RunEnvironment runEnv,
                          ExecutionRuntimeServices runtimeServices,
                          LanguageEventData.StepType stepType,
                          String stepName);

    /**
     * @param systemContext the system context
     * @return map of values provided by user
     */
    default Map<String, ? extends Value> applyValues(SystemContext systemContext, Collection<Input> inputs) {
        return Collections.emptyMap();
    }
}
